package com.affectu.opus;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.jboss.seam.annotations.Name;

import com.affectu.category.Category;
import com.affectu.common.base.EntityBase;
import com.affectu.user.User;

/**
 * Sep 28, 2008
 * 
 * @author daniel nathan
 */
@Entity
@Name("opus")
public class Opus extends EntityBase {

	private static final long serialVersionUID = -7824216221565978703L;

	@ManyToOne()
	@JoinColumn(name = "ownerId", referencedColumnName = "id")
	private User owner;

	private String imageUrl;

	private String topic;

	private String tags;

	@ManyToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "categoryId", referencedColumnName = "id")
	private Category category;

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public String getTopic() {
		return topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

}
